Skip to content

feat: ENG-12261 add OAuth 2.0 support and settings UI for Phrase integration#4699

Open
sanyamkamat wants to merge 23 commits into
mainfrom
add_oauth_option
Open

feat: ENG-12261 add OAuth 2.0 support and settings UI for Phrase integration#4699
sanyamkamat wants to merge 23 commits into
mainfrom
add_oauth_option

Conversation

@sanyamkamat

@sanyamkamat sanyamkamat commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Description

Adds OAuth 2.0 support and settings UI for Phrase integration


Note

Medium Risk
Touches authentication and all Phrase translation API calls via a new client path; OAuth/session edge cases (org switch, stale metadata, token expiry) need correct behavior in production.

Overview
Adds SSO / OAuth 2.0 as an alternative to username/password for the Phrase connector, with settings for auth mode, per-org OAuth Client ID, and a Connect / Disconnect panel that runs the Builder API popup flow (preparestartpostMessage). Access tokens stay on the server; the browser only tracks connection metadata plus apiKey-scoped session markers for connect/disconnect before org settings reload.

Replaces the direct Phrase client with PhraseApi, which calls /api/v1/memsource/* with the plugin private key, runs ensureAuthenticated for Translate/Apply, and retries after oauth/refresh on 401 in OAuth mode. Username/password fields are hidden when OAuth is selected; both credential types can coexist when switching modes.

README documents OAuth setup (redirect URI, US data center, sequence diagram). Package version bumps to 0.0.17-1; the stub Request an updated translation content action is removed while translation freshness checking is refactored into checkTranslationFreshness.

Reviewed by Cursor Bugbot for commit 7abd3c7. Bugbot is set up for automated code reviews on this repo. Configure here.

@sanyamkamat sanyamkamat requested review from a team and lihuelg and removed request for a team July 3, 2026 17:54
@changeset-bot

changeset-bot Bot commented Jul 3, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 7abd3c7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Comment thread plugins/phrase-conector/src/phrase-api.ts
Comment thread plugins/phrase-conector/src/phrase-api.ts Outdated
Comment thread plugins/phrase-conector/src/oauth-client.ts
Comment thread plugins/phrase-conector/src/plugin.tsx
Comment thread plugins/phrase-conector/src/oauth-client.ts
Comment thread plugins/phrase-conector/src/plugin.tsx Outdated
@nx-cloud

nx-cloud Bot commented Jul 3, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 854dc46

Command Status Duration Result
nx test @e2e/react-native-74 ✅ Succeeded 3m 26s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-07-07 11:00:40 UTC

Comment thread plugins/phrase-conector/src/phrase-api.ts
Comment thread plugins/phrase-conector/src/phrase-api.ts
Comment thread plugins/phrase-conector/src/plugin.tsx Outdated
Comment thread plugins/phrase-conector/src/oauth-client.ts
Comment thread plugins/phrase-conector/src/oauth-client.ts
Comment thread plugins/phrase-conector/src/plugin.tsx
Comment thread plugins/phrase-conector/src/plugin.tsx
Comment thread plugins/phrase-conector/src/phrase-api.ts
Comment thread plugins/phrase-conector/src/plugin.tsx Outdated
Comment thread plugins/phrase-conector/src/plugin.tsx Outdated
Comment thread plugins/phrase-conector/src/plugin.tsx
Comment thread plugins/phrase-conector/src/oauth-client.ts
@sanyamkamat sanyamkamat changed the title feat: add OAuth 2.0 support and settings UI for Phrase integration feat: ENG-12261 add OAuth 2.0 support and settings UI for Phrase integration Jul 5, 2026
Comment thread plugins/phrase-conector/src/phrase-api.ts
Comment thread plugins/phrase-conector/src/phrase-api.ts
Comment thread plugins/phrase-conector/src/oauth-client.ts Outdated
Comment thread plugins/phrase-conector/src/phrase-api.ts
Comment thread plugins/phrase-conector/src/phrase-api.ts
Comment thread plugins/phrase-conector/src/plugin.tsx
Comment thread plugins/phrase-conector/src/phrase-api.ts Outdated
Comment thread plugins/phrase-conector/src/phrase-api.ts
Comment thread plugins/phrase-conector/src/phrase-api.ts
Comment thread plugins/phrase-conector/src/phrase-api.ts

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 962ef5e. Configure here.

Comment thread plugins/phrase-conector/src/phrase-api.ts Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants